package br.com.listadecompras.activities;

import br.com.listadecompras.model.Item;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

public class ViewItemActivity extends Activity {
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		this.setContentView(R.layout.view_item);
		
		Intent intent = getIntent();
		
		if (intent != null && intent.getExtras().size() > 0) {
			TextView itemName = (TextView)this.findViewById(R.id.txtItemName);
			TextView itemDesc = (TextView)this.findViewById(R.id.txtItemDescription);
		
			itemName.setText(intent.getStringExtra(Item.NOME));
			itemDesc.setText(intent.getStringExtra(Item.DESCRICAO));
		}
	}
	
	public void callBack(View view) {
		finish();
	}
}
